<template>
    <div>
        Day01FatherCom == {{ str }}
        <Son ref="ref" v-model="str"></Son>
        <input type="text" v-focus>
    </div>
</template>

<script>
import Son from '@/views/Son.vue'

export default {
  name: 'Day01FatherCom',
  components: {
    Son
  },
  data () {
    return {
      str: '李云鹤真帅'
    }
  },
  provide () {
    return {
      str: this.str,
      click: this.doClick
    }
  },
  directives: {
    focus: {
      inserted (el, banding) {
        el.focus()
      }
    }
  },
  created () {
  },
  mounted () {
    console.log(this.$refs.ref)
  },

  methods: {
    doClick (str) {
      console.log(str)
      this.str = str
    }
  }
}
</script>

<style lang="scss" scoped>

</style>
